3.2.42 \(\int \frac {1}{\sqrt {a-a \sec (c+d x)}} \, dx\) [142]

Optimal. Leaf size=87 \[ \frac {2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d} \]

[Out]

2*arctan(a^(1/2)*tan(d*x+c)/(a-a*sec(d*x+c))^(1/2))/d/a^(1/2)-arctan(1/2*a^(1/2)*tan(d*x+c)*2^(1/2)/(a-a*sec(d
*x+c))^(1/2))*2^(1/2)/d/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3861, 3859, 209, 3880} \begin {gather*} \frac {2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/Sqrt[a - a*Sec[c + d*x]],x]

[Out]

(2*ArcTan[(Sqrt[a]*Tan[c + d*x])/Sqrt[a - a*Sec[c + d*x]]])/(Sqrt[a]*d) - (Sqrt[2]*ArcTan[(Sqrt[a]*Tan[c + d*x
])/(Sqrt[2]*Sqrt[a - a*Sec[c + d*x]])])/(Sqrt[a]*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3861

Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[1/a, Int[Sqrt[a + b*Csc[c + d*x]], x], x]
- Dist[b/a, Int[Csc[c + d*x]/Sqrt[a + b*Csc[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3880

Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2/f, Subst[Int[1/(2
*a + x^2), x], x, b*(Cot[e + f*x]/Sqrt[a + b*Csc[e + f*x]])], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0
]

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {a-a \sec (c+d x)}} \, dx &=\frac {\int \sqrt {a-a \sec (c+d x)} \, dx}{a}+\int \frac {\sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx\\ &=\frac {2 \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}-\frac {2 \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}\\ &=\frac {2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}-\frac {\sqrt {2} \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.49, size = 127, normalized size = 1.46 \begin {gather*} -\frac {i \left (-1+e^{i (c+d x)}\right ) \left (\sinh ^{-1}\left (e^{i (c+d x)}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {1+e^{i (c+d x)}}{\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}}\right )+\tanh ^{-1}\left (\sqrt {1+e^{2 i (c+d x)}}\right )\right )}{d \sqrt {1+e^{2 i (c+d x)}} \sqrt {a-a \sec (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[1/Sqrt[a - a*Sec[c + d*x]],x]

[Out]

((-I)*(-1 + E^(I*(c + d*x)))*(ArcSinh[E^(I*(c + d*x))] - Sqrt[2]*ArcTanh[(1 + E^(I*(c + d*x)))/(Sqrt[2]*Sqrt[1
 + E^((2*I)*(c + d*x))])] + ArcTanh[Sqrt[1 + E^((2*I)*(c + d*x))]]))/(d*Sqrt[1 + E^((2*I)*(c + d*x))]*Sqrt[a -
 a*Sec[c + d*x]])

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 119, normalized size = 1.37

method result size
default \(-\frac {\left (\sqrt {2}\, \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right )+2 \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right )\right ) \left (-1+\cos \left (d x +c \right )\right ) \sqrt {2}}{d \sqrt {\frac {a \left (-1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \sin \left (d x +c \right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\) \(119\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a-a*sec(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/d*(2^(1/2)*arctan(1/(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2))+2*arctan(1/2*(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2)
*2^(1/2)))*(-1+cos(d*x+c))/(a*(-1+cos(d*x+c))/cos(d*x+c))^(1/2)/sin(d*x+c)/(-2*cos(d*x+c)/(1+cos(d*x+c)))^(1/2
)*2^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a-a*sec(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: sign: argument cannot be imaginary
; found %i

________________________________________________________________________________________

Fricas [A]
time = 2.43, size = 301, normalized size = 3.46 \begin {gather*} \left [\frac {\sqrt {2} a \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} - {\left (3 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )}{{\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}\right ) - 2 \, \sqrt {-a} \log \left (\frac {2 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} - {\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{\sin \left (d x + c\right )}\right )}{2 \, a d}, \frac {\sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) - 2 \, \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right )}{a d}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a-a*sec(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(2)*a*sqrt(-1/a)*log(-(2*sqrt(2)*(cos(d*x + c)^2 + cos(d*x + c))*sqrt((a*cos(d*x + c) - a)/cos(d*x +
 c))*sqrt(-1/a) - (3*cos(d*x + c) + 1)*sin(d*x + c))/((cos(d*x + c) - 1)*sin(d*x + c))) - 2*sqrt(-a)*log((2*(c
os(d*x + c)^2 + cos(d*x + c))*sqrt(-a)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c)) - (2*a*cos(d*x + c) + a)*sin(d*
x + c))/sin(d*x + c)))/(a*d), (sqrt(2)*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*cos(d*x
+ c)/(sqrt(a)*sin(d*x + c))) - 2*sqrt(a)*arctan(sqrt((a*cos(d*x + c) - a)/cos(d*x + c))*cos(d*x + c)/(sqrt(a)*
sin(d*x + c))))/(a*d)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a-a*sec(d*x+c))**(1/2),x)

[Out]

Integral(1/sqrt(-a*sec(c + d*x) + a), x)

________________________________________________________________________________________

Giac [A]
time = 0.77, size = 69, normalized size = 0.79 \begin {gather*} \frac {\frac {\sqrt {2} \arctan \left (\frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{\sqrt {a}}\right )}{\sqrt {a}} - \frac {2 \, \arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{2 \, \sqrt {a}}\right )}{\sqrt {a}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a-a*sec(d*x+c))^(1/2),x, algorithm="giac")

[Out]

(sqrt(2)*arctan(sqrt(a*tan(1/2*d*x + 1/2*c)^2 - a)/sqrt(a))/sqrt(a) - 2*arctan(1/2*sqrt(2)*sqrt(a*tan(1/2*d*x
+ 1/2*c)^2 - a)/sqrt(a))/sqrt(a))/d

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{\sqrt {a-\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a - a/cos(c + d*x))^(1/2),x)

[Out]

int(1/(a - a/cos(c + d*x))^(1/2), x)

________________________________________________________________________________________